import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Objects;

public class ImageFiler {
    public static BufferedImage heroplane;
    public static BufferedImage heroplane1;

    public static BufferedImage smallenemy;
    public static BufferedImage smallenemy1;
    public static BufferedImage smallenemy2;
    public static BufferedImage smallenemy3;
    public static BufferedImage smallenemy4;
    public static BufferedImage bigenemy;
    public static BufferedImage bigenemy1;
    public static BufferedImage bigenemy2;
    public static BufferedImage bigenemy3;
    public static BufferedImage bigenemy4;
    public static BufferedImage bee;
    public static BufferedImage bee1;
    public static BufferedImage bee2;
    public static BufferedImage bee3;
    public static BufferedImage bee4;
    public static BufferedImage bullet;

    public static BufferedImage start;
    public static BufferedImage pause;
    public static BufferedImage gameover;

    static {

        try {
            //英雄机
            heroplane = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/hero0.png")));
            heroplane1 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/hero1.png")));
            //小敌机
            smallenemy = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/airplane.png")));
            smallenemy1 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/airplane_ember0.png")));
            smallenemy2 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/airplane_ember1.png")));
            smallenemy3 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/airplane_ember2.png")));
            smallenemy4 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/airplane_ember3.png")));

            //大敌机
            bigenemy = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bigplane.png")));
            bigenemy1 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bigplane_ember0.png")));
            bigenemy2 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bigplane_ember1.png")));
            bigenemy3 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bigplane_ember2.png")));
            bigenemy4 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bigplane_ember3.png")));

            //小蜜蜂
            bee = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bee.png")));
            bee1 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bee_ember0.png")));
            bee2 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bee_ember1.png")));
            bee3 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bee_ember2.png")));
            bee4 = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bee_ember3.png")));
            //子弹
            bullet = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/bullet.png")));

            //开始状态
            start = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/start.png")));
            //暂停状态
            pause = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/pause.png")));
            //游戏结束
            gameover = ImageIO.read(Objects.requireNonNull(ImageFiler.class.getResourceAsStream("image/gameover.png")));


        } catch (IOException e) {
            e.printStackTrace();
        }


    }
}
